/* 
 JS packs.js
 @Autor: Frank Peña Ponce
 @Fecha: 09/05/2012
 @Modificado por: Frank Peña Ponce
 @Fecha de Modificacion: 10/05/2012
 @Funcion: Sirve para importar todo los js necesarios para el funcionamiento de la web.
*/

function jsInclude()
{
    var pathtojsfiles = "js/";
    var modules = [                
//        { include: true, incfile:'generals/grid.base.js'}, // jqGrid base
//        { include: true, incfile:'generals/grid.common.js'}, // jqGrid common for editing
//        { include: true, incfile:'generals/grid.formedit.js'}, // jqGrid Form editing
//        { include: true, incfile:'generals/grid.inlinedit.js'}, // jqGrid inline editing
//        { include: true, incfile:'generals/grid.celledit.js'}, // jqGrid cell editing
//        { include: true, incfile:'generals/grid.subgrid.js'}, //jqGrid subgrid
//        { include: true, incfile:'generals/grid.treegrid.js'}, //jqGrid treegrid
//        { include: true, incfile:'generals/grid.custom.js'}, //jqGrid custom 
//        { include: true, incfile:'generals/grid.postext.js'}, //jqGrid postext
//        { include: true, incfile:'generals/grid.tbltogrid.js'}, //jqGrid table to grid 
//        { include: true, incfile:'generals/grid.setcolumns.js'}, //jqGrid setcolumns
//        { include: true, incfile:'generals/grid.import.js'}, //jqGrid import  
//        { include: true, incfile:'generals/number-format.js'},//Formate
//        { include: true, incfile:'generals/grid.grouping.js'}, //grouping
//        { include: true, incfile:'generals/jqModal.js'}, //xmljson utils
//        { include: true, incfile:'generals/jqDnR.js'}, //xmljson utils
//        { include: true, incfile:'generals/JsonXml.js'}, //xmljson utils
//        { include: true, incfile:'generals/grid.jqueryui.js'}, //xmljson utils 
//        { include: true, incfile:'generals/jquery.searchFilter.js'}, // search Plugin  
        { include: true, incfile:'generals/jquery.tiptip.js'},
        { include: true, incfile:'generals/buttons.js'},
        { include: true, incfile:'generals/panel.js'},                                                                                            
       // { include: true, incfile:'generals/jquery.fmatter.js'}, //jqGrid formater        
        { include: true, incfile:'generals/enter_press.js'}
    ];
    var filename;
    for(var i=0;i<modules.length; i++)
    {
        if(modules[i].include === true) {
        	
        	filename = pathtojsfiles+modules[i].incfile;
       		if(jQuery.browser.safari ) {
       			jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
       		} else {
				if (jQuery.browser.msie) {
        			document.write('<script type="text/javascript" src="'+filename+'"></script>');
				} else {
        			IncludeJavaScript(filename);
				}
			}
        }
    }
    function IncludeJavaScript(jsFile)
    {
        var oHead = document.getElementsByTagName('head')[0];
        var oScript = document.createElement('script');
        oScript.type = 'text/javascript';
        oScript.charset = 'utf-8';
        oScript.src = jsFile;
        oHead.appendChild(oScript);        
    };
};
jsInclude();